<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/reset.css"/>
	</head>
	<body>
		<input type="text" name="" id="name" value="" />
	</body>
</html>
<script src="js/jQuery.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	for(let i=0;i<100;i++){
		let a = parseInt(randomNum(50,1000));
		document.body.innerHTML +=`<p>insert into goodstable value (${i},"标题","${a}","./mainimg/mainimg (${i+1}).jpg");</p>`;
	}
	function randomNum(minNum,maxNum){ 
	    switch(arguments.length){ 
	        case 1: 
	            return parseInt(Math.random()*minNum+1,10); 
	        break; 
	        case 2: 
	            return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10); 
	        break; 
	            default: 
	                return 0; 
	            break; 
	    } 
	} 
	let arr = [];
	$("#name").blur(function(){
		$.post("./php/text.php",{
			"name":$("#name").val()
		},function(resText,statis){
			arr = JSON.parse(resText);
			for(i=0;i<arr.length;i++){
				console.log(arr[i].gt_id);
			}
		})
	})
	
</script>